package oop2.Task2;

public class Ship {
    int load;   //载重
    int displacement;   //排水量
    int speedMax;   //最大航速

    public Ship(int load, int displacement, int speedMax) {
        this.load = load;
        this.displacement = displacement;
        this.speedMax = speedMax;
    }

    public void show() {
        System.out.println("轮船载重量:" + load + "吨,排水量:" + displacement + ",最大航速每小时" + speedMax+"海里");
    }

    public void setSail() {     //启航
        System.out.println("轮船起航了");
    }

    public void whistle() {     //鸣笛
        System.out.println("轮船鸣笛了");
    }

    public void anchor() {     //抛锚
        System.out.println("轮船抛锚了");
    }
}
